package shenxg.game;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.Random;

public class GameStart {

	static public int smallstSet = 8;
	static public boolean useSet = false;
	static public String logFile = "e:/temp/log.txt";
	public static Random random = new Random(System.currentTimeMillis());
	
	public static void main(String args[]) throws Exception {
		//
		//setOut();
		System.out.println("smallstSet : " + smallstSet);
		long millisecondsStartTime = System.currentTimeMillis();
		System.out.println("millisecondsStartTime : " + millisecondsStartTime);
		
		File file = new File("e:/temp/1.jpg");
		Scene scene = new Scene(file);
		System.out.println("Start!!!");
		scene.calculate();
		Scene bestscene = scene.bestFinalScene;
		if (null == bestscene) {
			System.out.println("bestscene is null!!!!!");
			return;
		}
		System.out.println("bestscene score is : " + bestscene.getFinalScore());

		long millisecondsEndTime = System.currentTimeMillis();
		System.out.println("millisecondsEndTime : " + millisecondsEndTime);
		System.out.println("millisecondsSpendTime : " + (millisecondsEndTime - millisecondsStartTime));
	}
	
	public static void setOut() throws FileNotFoundException{
		File file_log = new File(logFile);
		FileOutputStream fis = new FileOutputStream(file_log);
		PrintStream out = new PrintStream(fis);
		System.setOut(out);
	}
}
